package org.elip.teststatistics.server.selectors;

import org.apache.commons.vfs2.FileSelectInfo;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.FileTypeSelector;

public class SuiteFolderSelector extends FileTypeSelector {

	private String suiteName;
	
	public SuiteFolderSelector(FileType type, String name) {
		super(type);
		this.suiteName = name;
	}
	
	@Override
	public boolean includeFile(FileSelectInfo fileInfo) {
		return fileInfo.getFile().getName().getBaseName().equals(suiteName);
	}
	
	@Override
	public boolean traverseDescendents(FileSelectInfo fileInfo) {
		if (fileInfo.getDepth() == 0) return true;
		return false;
	}
}
